<?php
$this->headTitle('Zdroje | Uživatelé | Administrace | Knihovna');
?>

<div id="dialog-form" title="Smazat zdroj">
    <p>Opravdu chcete smazat položku?</p>
    <?php
        print $this->form->render();
    ?>
</div>

<h2>Zdroje</h2>
<p></p><a class="add" href="<?php echo $this->url(array('module'     => 'admin',
    'controller' => 'resources',
    'action'     => 'add'));?>">Přidat</a></p>

<?php
foreach ($this->message as $key => $value)
{
    $value = explode("|", $value);
    ?>
<div class="message <?php print $value[0]; ?>"><p><?php print $value[1]; ?></p></div>
<?php
}
?>

<table class="ui-widget ui-widget-content">
    <tr class="ui-widget-header">
        <th>Název</th>
        <th>Rodič</th>
        <th></th>
    </tr>
    <?php
    foreach ($this->resources as $key => $value)
    {
        ?>
        <tr>
            <td><?php print $value['nazev']; ?></td>
            <td><?php print $value['rodic']; ?></td>
            <td>
                <a class="edit" href="<?php echo $this->url(array('module'     => 'admin',
                    'controller' => 'resources',
                    'action'     => 'edit',
                    'id'         => $value['nazev']));?>">Editovat</a>
                <a class="delete delete-role" data-id="<?php echo $value['nazev'];?>" href="#">Smazat</a>

                </a>
            </td>
        </tr>
        <?php
    }
    ?>
</table>
